#ifndef FRAME__H
#define FRAME__H

#include <iostream>
#include <string>
#include <SDL.h>
#include "ioManager.h"

class Frame {
public:
  // Must pass both width and height here because the sprite might
  // not consist of the whole surface, only part of the surface.
  Frame( const std::string& fn,
      int sprite_width, int sprite_height,
      int src_x, int src_y, bool setcolorkey);
 Frame( SDL_Surface* spr, int sprite_width, int sprite_height,
         int src_x, int src_y);
         
  Frame(const Frame&);
  Frame& operator=(const Frame&);
  ~Frame() {  
    std::cout<<"deleting surface"<<std::endl;    
  }

  void draw(int x, int y) const;
  void draw(int sx, int sy, int dx, int dy) const;
  SDL_Surface* getSurface() const { return spriteSurface; }
  Uint16 getWidth()  const { return spriteWidth; }
  Uint16 getHeight() const { return spriteHeight; }
  Uint16 getSourceX()  const { return spriteSourceX; }
  Uint16 getSourceY() const { return spriteSourceY; }

private:
  SDL_Surface *  spriteSurface;
  SDL_Surface *  screen;
  int spriteWidth;
  int spriteHeight;
  int spriteSourceX;
  int spriteSourceY;

};

#endif
